import Vue from 'vue'
import Router from 'vue-router'
import BlogList from '@/views/BlogList'
import BlogDetail from '@/views/BlogDetail'
import WriteBlog from '@/views/WriteBlog'
import Login from '@/views/Login'
import Register from '@/views/Register'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'blogList',
      component: BlogList
    },
    {
      path: '/blogList',
      name: 'blogList',
      component: BlogList
    },
    {
      path: '/blogDetail',
      name: 'blogDetail',
      component: BlogDetail
    },
    {
      path:'/writeBlog',
      name:'writeBlog',
      meta: { requiresAuth: true },
      component: WriteBlog
    },
    {
      path:'/register',
      name:'register',
      component: Register
    },
    {
      path:'/login',
      name:'login',
      component: Login
    }
  ]
})
